#
#
CLEANFILES = *~
DISTCLEANFILES = *~

bin_PROGRAMS = mkentity

AM_YFLAGS = -d -p mke -t
AM_LFLAGS = -Pmke --nounistd

if ECM_PARSER

BUILT_SOURCES = mkeparser.c mkescan_dbg.c mkescan_nodbg.c

mkescan_dbg.c: mkescan.l
	flex $(AM_LFLAGS) -d -o$@ $<

mkescan_nodbg.c: mkescan.l
	flex $(AM_LFLAGS) -o$@ $<

PARSER_SOURCES = mkeparser.y

else

PARSER_SOURCES = mkeparser.c

endif

if ECM_DEBUG

SCANNER_SOURCES = mkescan_dbg.c

DUMMY_SYMBOLS = -u sr_fancy_print

else

SCANNER_SOURCES = mkescan_nodbg.c

DUMMY_SYMBOLS = -u ecm_error -u ecm_assert

endif

SOURCES_common = mkentity.c specobj.c bind.c mkentity.h \
		mke_UI.c mke_err.c mke_err.h mke_utils.c \
		../edbd/bdexpr.c ../edbd/edbd_basefunc.c \
		../edbd/extcall_dummy.c

mkentity_SOURCES = $(SOURCES_common) $(PARSER_SOURCES) $(SCANNER_SOURCES)

INCLUDES = -I../../lib/libbase -I../../lib/libsr -I../../lib/libebc -I../../lib/libedb -I../../lib/libeds -I../edbd

mkentity_CFLAGS = -DNO_EDBDDBG -DBDEXPR_MKENTITY
mkentity_LDFLAGS = -export-dynamic $(DUMMY_SYMBOLS)

mkentity_LDADD = ../../lib/libeds/libeds.la \
		../../lib/libedb/libedb.la \
		../../lib/libebc/libebc.la \
		../../lib/libsr/libsr.la \
		../../lib/libbase/libbase.la \
		-lhistory -lcurses -lm @LINK_DL@ -lbfd @BFD_DEP_LIBS@ -lpthread

EXTRA_DIST = mkescan_dbg.c mkescan_nodbg.c mkescan.l
